/** 返回参数 */
export const returnParams = (res, data) => {
  res.send({
    code: 200,
    data: data,
  })
};
/** 错误返回数据 */
export const errorParams = (res, err, errStr) => {
  res.send({
    code: 100,
    err,
    message: errStr || '请求失败',
  })
};

/** 获取get请求的参数 */
export const getParam = (req, key) => (req.query || req.params)[key];